#{extends 'layout.html'/}
#{set 'menu'}
<ul>
    <li id="home"><a href="/${event.nick}">HOME</a></li>

    #{secure.check models.Task.GESTION_EVENTO + '|'+ event.nick }
        <li id=""><a href="/${event.nick}/manageEvent">Gestionar Evento</a></li>
    #{/secure.check}
    #{secure.check models.Task.GESTION_PONENCIAS + '|'+ event.nick }
        <li id="managePresentations"><a href="/${event.nick}/managePresentations/show">Gestionar Sumilla</a></li>
    #{/secure.check}
    #{secure.check models.Task.GESTION_AUDITORIOS + '|'+ event.nick }
        <li id="managePresentations"><a href="/${event.nick}/manageAuditoriums">Gestionar Auditorios</a></li>
    #{/secure.check}

    #{ifnot session.get("username")}
        <li id="managePresentations"><a href="/${event.nick}/managePresentations">Ver Sumilla</a></li>
    #{/ifnot}

    #{secure.check models.Task.GESTION_INSCRIPCIONES + '|'+ event.nick}
        <li id=""><a href="#">Gestionar Inscripciones</a></li>
    #{/secure.check}
    #{secure.check models.Task.GESTION_ASISTENCIAS + '|'+ event.nick}
        <li id=""><a href="#">Gestionar Asistencias</a></li>
    #{/secure.check}
    <li id="form"><a href="/${event.nick}/form">Registrarse</a></li>


    #{secure.check models.Profile.SUPERADMIN}
        <li><a href="@{Application.index()}">Ver todos los eventos</a></li>
    #{/secure.check}

</ul>
#{/set}
#{set 'moreScripts'}
<script>
    $(document).ready(function () {
        var currentUrl = $(location).attr('href');
//        console.log(currentUrl);
        var layer = $(location).attr('href').match('(\\/[\\da-zA-Z:0-9\\.-]+\\/[\\da-zA-Z\\.-]+\\/)([\\da-zA-Z\\.-]+)()');
        if (layer == null) {
            layer = 'home';
        } else {
            layer = layer[2];
        }
//        console.log(layer);

        var text = $('#' + layer + ' a').text();
        $('#' + layer).addClass("active");
        $('#' + layer + ' a').remove();
        $('#' + layer).html("<strong>" + text + "</strong>");
    });

</script>
#{/set}
<style>

    body {
    ${event.backgroundStyle}
    }

    #header {
    ${event.headerStyle}
    }

    h1 {
    ${event.h1Style}
    }

    #menu_nav {
    ${event.navStyle}
    }

</style>
#{doLayout /}